﻿// (c)Lyosha Alefirov, 2013
// Interpreter of language L
module TestProgram
open System
open System.IO
open LLexer
open LParser

[<EntryPoint>]
let main argv = 
    
    let source = File.ReadAllText(argv.[0])
    let lexer:LLexer = Unknown, source |> List.ofSeq
    let f = fun (cl, _ ) -> printf "// %A  " cl
    let printStep = LLexer.MoveNext +& f
    //(many printStep (fun (x,_) -> x <> EOP) lexer) |> ignore
    let tokens, _ = CurrentMoveNextTokens lexer 21
    tokens |> List.map (fun x -> printf "// %A  " x) |> ignore
    
    let tree = LParser.ParseStatement lexer
    
    Console.Read() |> ignore
    0 // return an integer exit code
